package com.hfkz.project.action;

import java.util.Date;
import java.util.List;

import com.hfkz.project.db.JDBCHelper;
import com.hfkz.project.domain.Book;
import com.hfkz.project.serivce.BookService;

public class BookServiceAction extends BaseAction{

	private Book book;
	private List<Book> bookList;
	private BookService bService = new BookService();
	private String result;
	
	/*
	 * 往数据库插入数据
	 *
	 */
	public String insertBookInformation(){
		bService.insert(book);
		return "insertInformation";
	}
	
	public String pageInsertBookInformation(){
		return "page";
	}
	
	public String queryBook(){
		
		bookList = bService.bookQuery();
		System.out.println(bookList.size());
		return "queryBook";
	}
	
	public String queryBook(String bookName){
		
		bookList = bService.bookQuery(bookName);
		System.out.println(bookList.size());
		return "queryBook";
	}
	
	
	public Book getBook() {
		return book;
	}
	
	public void setBook(Book book) {
		this.book = book;
	}

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public List<Book> getBookList() {
		return bookList;
	}

	public void setBookList(List<Book> bookList) {
		this.bookList = bookList;
	}
	
	
	
	
	//bookName,bookPrice,author,publisher,publishDate,isbn,total,message,classify
	
	/*public String easySQL(){
		return "qq" ;
	}*/
	
	/*public void insert(String bookName,String bookPrice,String author,String publisher,String publishDate,String isbn,String total,String message,String classify ){
		String sql ="insert into t_book (book_name,book_price,book_author,book_publisher,book_publish_date,book_ISBN,book_total,book_message,book_classify) values(?,?,?,?,?,?,?,?,?)";
		boolean flag = JDBCHelper.execute(sql, new Object[]{bookName,bookPrice,author,publisher,publishDate,isbn,total,message,classify});
	}*/
}